package com.fdb.efp.nls.service.common.rules.credit;

import com.fdb.basic.framework.core.constant.EsbRetCodeStandard;
import com.fdb.basic.framework.core.exception.BizException;
import com.fdb.efp.nls.service.common.rules.CheckRule;
import com.fdb.efp.nls.service.vo.sx.NlsCreditInfoVO;

import java.util.Objects;

/**
 * 需求编号:2019D08--
 * 问题编号:
 * 开发人员: caoxin
 * 创建日期:2019/12/4
 * 功能描述:
 * 修改日期:2019/12/4
 * 修改描述:
 */
public class HasCreditInfoRule implements CheckRule {
    private NlsCreditInfoVO nlsCreditInfoVO;

    public HasCreditInfoRule(NlsCreditInfoVO nlsCreditInfoVO) {
        this.nlsCreditInfoVO = nlsCreditInfoVO;
    }

    @Override
    public void check() throws BizException {
        if (Objects.isNull(nlsCreditInfoVO)) {
            throw new BizException(EsbRetCodeStandard.WFJKYWGZ.getValue(), "CrAppSrlNo授信申请流水号对应的授信信息不存在，请核查！");
        }
    }
}
